public class Num2185 {
    public int prefixCount(String[] words, String pref) {
        int count = 0;
        int len = pref.length();
        for (String s : words) {
            if (s.length() >= len && s.substring(0,len).equals(pref)) count++;
        }
        return count;
    }
}
